package com.ori.dao;

import com.ori.pojo.Flysysuser;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Pretty·Boy
 * @date 2018/12/23 11:09
 */
public class MyTest {
    /**
     * 初始化Spring容器
     *
     * @author pretty_boy
     * @time 2018/12/23
     */
    private ApplicationContext applicationContext;

    @Before
    public void init() {
        applicationContext = new ClassPathXmlApplicationContext("spring-config.xml");
    }

    @Test
    public void oriDao() {
        UserDao userDaoImpl = (UserDao) applicationContext.getBean("userDaoImpl");
        Flysysuser flysysuser = userDaoImpl.getUserByid(9);
        System.out.println("flysysuser = " + flysysuser);
    }
}
